home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 August / August CD.bin / Shareware / Education / numericalmethods Folder / chap_4 / zlog.m < prev    next >
Encoding:
Text File  |  1994-06-05  |  852 b   |  53 lines  |  [MATF/MATL]

  1. function [fun,dfun,ifun,x0,m,C,Ax] = zlog
  2. % Taylor series coefficient lists for several functions.
  3. % Pm(x) = c(1) + c(2)x + c(2)x^2 + ... + c(m+1)x^m
  4. % fun  is the function, output.
  5. % dfun is the derivative, output.
  6. % ifun is the integral, output.
  7. % x0 is the point of expansion, output.
  8. % m  is the degree of the polynomial, output.
  9. % C  is the coefficient list, output.
  10. % Ax contains three asis vectors plotting, output.
  11. x0 = 0; 
  12. m = 25;
  13. a = -0.999;
  14. b = 1.0;
  15. ymin = -2.5;
  16. ymax = 1.0;
  17. ymin1 = -0.5;
  18. ymax1 = 10;
  19. ymin2 = -0.06;
  20. ymax2 = 1;
  21. Ax(1,:) = [a b ymin ymax];
  22. Ax(2,:) = [a b ymin1 ymax1];
  23. Ax(3,:) = [a b ymin2 ymax2];
  24. fun = 'log(1+x)';
  25. dfun = '(1+x).^(-1)';
  26. ifun = '-x+(1+x).*log(1+x)';
  27. C = [1/25,
  28. -1/24,
  29. 1/23,
  30. -1/22,
  31. 1/21,
  32. -1/20,
  33. 1/19,
  34. -1/18,
  35. 1/17,
  36. -1/16,
  37. 1/15,
  38. -1/14,
  39. 1/13,
  40. -1/12,
  41. 1/11,
  42. -1/10,
  43. 1/9,
  44. -1/8,
  45. 1/7,
  46. -1/6,
  47. 1/5,
  48. -1/4,
  49. 1/3,
  50. -1/2,
  51. 1,
  52. 0];
  53.